package com.airticketbooking.service.serviceImpl;


import com.airticketbooking.po.Airline;
import com.airticketbooking.query.AirlinePageQuery;
import com.airticketbooking.mapper.AirlineMapper;
import com.airticketbooking.service.AirlineService;
import com.github.pagehelper.PageHelper;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import org.springframework.data.domain.Page;


@Service
@RequiredArgsConstructor

public class AirlineServiceImpl implements AirlineService {

	private final AirlineMapper airlineMapper;

	/**
	 * 通过ID查询单条数据
	 *
	 * @param airlineId 主键
	 * @return 实例对象
	 */
	@Override
	public Airline queryById(Integer airlineId) {
		return airlineMapper.queryById(airlineId);
	}



	@Override
	public Page<Airline> queryByPage(AirlinePageQuery airlinePageQuery) {

		PageHelper.startPage(airlinePageQuery.getPageNo(), airlinePageQuery.getPageSize());


		Page<Airline> airlinePage = airlineMapper.queryByPage(airlinePageQuery);

		return airlinePage;

	}


}
